<template>
	<view>
		<my-login v-if="!token"></my-login>
		<my-userinfo v-else></my-userinfo>
	</view>
</template>

<script>
	import {
		mapMutations,
		mapGetters,
		mapState
	} from 'vuex'
	export default {
		data() {
			return {

			}
		},
		onShow() {
			this.setBadge(this.total)
		},
		watch: {
			total(newVal) {
				this.setBadge(newVal)
			}
		},
		computed: {
			...mapGetters('m_cart', ['total']),
			...mapState('m_user', ['token'])
		},
		methods: {
			...mapMutations('m_cart', ['setBadge'])

		}
	}
</script>

<style>

</style>
